Quantitative Methodology (UPF)
Load packages.
One function
Various functions
Without pipe
With pipe
Reduces the number of rows according to a certain criteria
& (AND), | (OR), ! (NOR).Renames the vector.
*Mind the argument na.rm = T.
summarize, filter, mutate), it groups the data by the values of a vector1…*With group_by and summarize, we change the unit of observation of the dataset.
When we recode variables (vectors), we lose information.
| Destí | Funció |
|---|---|
| Binària | if_else() |
| Categòrica | case_when() |
| Ordinal | factor() |
| Qualsevol | recode() |
| Altres | as.numeric(), as.character(), as.Date(), etc. |
&): TRUE if all conditions are met.|): TRUE if any condition is met.!): TRUE if conditions are not met.as.numeric(vector)as.factor(vector)as.character(vector)as.integer(vector)as.Date(vector)Quantitative Methodology (UPF)